<template>
	<div class="wrap" v-if="isShow" @click="btnClose">
		<div class="dialog" @mousewheel="(e)=>{e.stopPropagation()}">
			<iframe height="600px" v-if="!isMobile" :frameborder="0" width="600px" src="https://yzf.qq.com/xv/web/static/chat/index.html?sign=37ef9b9780275393224c99ea48b4b163b4d944cb72b98c4f9e590080457f0225dda125b63937827725581c0b2818644735e24015"></iframe>
			<div class="close">
				<img :src="require(`@/static/close.png`)" />
			</div>
		</div>
</div>
</template>
<script>
import { browserRedirect } from '@/components/mobileConsult.js'
export default {
  props: {
	},
	data () {
		return {
			isShow: false,
      isMobile: false
		}
	},
	mounted () {
    this.isMobile = browserRedirect()
  },
	methods: {
		action () {
			const url = 'https://yzf.qq.com/xv/web/static/chat/index.html?sign=37ef9b9780275393224c99ea48b4b163b4d944cb72b98c4f9e590080457f0225dda125b63937827725581c0b2818644735e24015'
			if (this.isMobile) {
				window.location.href = url
			} else {
				// this.isShow = !this.isShow
				window.open(url, '_blank')
			}
		},
		btnClose () {
			this.isShow = !this.isShow
		}
	}
}
</script>
<style lang="sass" scoped>
.wrap
	width: 100%
	height: 100%
	position: fixed
	top: 0
	left: 0
	z-index: 100000
	background: rgba(0, 0, 0, 0.5)
	.dialog
		width: 600px
		height: 600px
		position: fixed
		top: 50%
		left: 50%
		margin-left: -300px
		margin-top: -300px
		z-index: 100000
		.close
			position: absolute
			top: 14px
			right: 60px
			cursor: pointer
			img
				width: 22px
</style>
